package main

import (
	"log"
	"net"
	"net/rpc"
	. "test-go/src/rpc/hello_rpc"
)

func main() {
	RegisterHelloService(new(HelloService))
	listener, err := net.Listen(NETWORK, ADDRESS)
	if err != nil {
		log.Fatalln("Listen TCP error:", err)
	}
	conn, err := listener.Accept()
	if err != nil {
		log.Fatalln("Accept error:", err)
	}
	rpc.ServeConn(conn)
	//rpc.ServeCodec(jsonrpc.NewServerCodec(conn))
}
